home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Interactive Media Design Review 1999
/
Interactive Media Design Review 1999.iso
/
pc
/
Demos
/
Herois
/
Codigo.Cst
/
00007_Script_Claquete
< prev
next >
Wrap
Text File
|
1999-03-19
|
3KB
|
104 lines
property spr, mem, ativo
property anima, ultimoUpdate
property saida, memSaida
on beginSprite me
set spr = the spriteNum of me
set anima = 0
set the visibility of sprite spr to false
set mem = the number of member "Claq1"
set memSaida = the number of member "SaidaPopUp"
set ativo to false
set saida to false
end
on cleanSprite me
chaveSaida me, false
end
on chaveSaida me, liga
if saida = liga then return
set saida = liga
if saida then
if ativo then return
puppetSprite spr, true
set the member of sprite spr to member memSaida
set the visibility of sprite spr to true
set anima = 0
set ultimoUpdate = the timer
global gCritico
set gCritico = gCritico + 1
else
set the member of sprite spr to mem
set the visibility of sprite spr to false
set gCritico = gCritico - 1
end if
end
on comecaAnima me
set anima = 0
set the member of sprite spr to mem
set the visibility of sprite spr to true
set ultimoUpdate to the timer
set ativo to true
end
on finalizaAnima me
set the visibility of sprite spr to false
set ativo to false
end
on idleClaquete me
if ativo and the timer - ultimoUpdate > 2 then
set ultimoUpdate = the timer
set anima = anima + 1
if anima > 7 then set anima = 0
set the member of sprite spr to (mem + anima)
updateStage
end if
end
on idleSprite me
global gMustUpdate
if not saida then return
if the timer - ultimoUpdate > 30 then
set anima = 1 - anima
set ultimoUpdate = the timer
end if
set tmp = anima * 3
set p = point(the mouseH, the mouseV)
if inside(p,rect(285,229,320,243)) then
set tmp = tmp + 1
else if inside(p,rect(320,243,354,258)) then
set tmp = tmp + 2
end if
set tmp = tmp + memSaida
set tmp2 = the number of the member of sprite spr
if tmp <> tmp2 then
set the member of sprite spr to tmp
set gMustUpdate to true
end if
end
on mouseUp me
if saida then
set p = point(the mouseH, the mouseV)
if inside(p,rect(285,229,320,243)) then
cursor 4
calculaDonde
global gPronde
set gPronde = 0
sendAllSPrites(#cleanSprite)
sendSprite 97, #chaveVisibilidade, false
puppetSprite spr, false
set the visibility of sprite spr to false
go frame "Saida"
cursor -1
else if inside(p,rect(320,243,354,258)) then
chaveSaida me, false
end if
end if
end